<?php

/* Author: Panos Sakkos
 * Deletes the category with the given category id
 */

function BL_delete_category($categoryId, $ownerId)
{
    $category = DB_getCategory($categoryId);
    $user = DB_getUserData($ownerId);

    //cross exam if the user that wants to delete the category is it's owners
    if (  ($ownerId == $category->GetOwner()) || ($user->getUserType() == "adm"))
    {
        BL_disableCategory($categoryId); //soft delete the category
        return BL_OK;
    }
    else
        return BL_NOT_OWNER;
}
?>
